Two functions are available for use in creating previews. The PreviewMakePreview function creates previews by allocating a handle to data to be added to the file. On the other hand, the PreviewMakePreviewReference function makes previews by returning the type and identification number of a resource within the file to be used as the preview for the file.
The PreviewMakePreview function creates previews by allocating a handle to data that is to be added to the file.
pascal ComponentResult PreviewMakePreview (pnotComponent p,
OSType *previewType,
Handle *previewResult,
const FSSpec *sourceFile,
ICMProgressProcRecordPtr progress);
Instead of creating a handle to data that is to be added to the file, the PreviewMakePreviewReference function returns the type and identification number of a resource within the file to be used as the preview for the file.
pascal ComponentResult PreviewMakePreviewReference
(pnotComponent p, OSType *previewType,
short *resID, const FSSpec *sourceFile);
If your preview component creates previews by reference, you must also implement the PreviewMakePreview function, described in the previous section. However, you should return an error from it. PreviewMakePreview is always called first. If it fails, PreviewMakePreviewReference is tried next .